<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Maven项目刷新指南</title>
    <style>
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background-color: #f5f5f5;
            color: #333;
            line-height: 1.6;
            padding: 20px;
            max-width: 1200px;
            margin: 0 auto;
        }

        header {
            text-align: center;
            margin-bottom: 40px;
            padding: 20px;
            background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
            color: white;
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }

        h1 {
            font-size: 2.5rem;
            margin-bottom: 10px;
        }

        .subtitle {
            font-size: 1.2rem;
            opacity: 0.9;
        }

        .container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            margin-bottom: 40px;
        }

        .card {
            background: white;
            border-radius: 10px;
            padding: 25px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s ease;
        }

        .card:hover {
            transform: translateY(-5px);
        }

        .card h2 {
            color: #2575fc;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 2px solid #f0f0f0;
        }

        .ide-card {
            border-top: 4px solid #ff6b6b;
        }

        .cli-card {
            border-top: 4px solid #4ecdc4;
        }

        .cache-card {
            border-top: 4px solid #ffd166;
        }

        .code {
            background-color: #2d2d2d;
            color: #f8f8f2;
            padding: 15px;
            border-radius: 5px;
            overflow-x: auto;
            margin: 15px 0;
            font-family: 'Fira Code', monospace;
        }

        .key {
            display: inline-block;
            background: #eaeaea;
            padding: 2px 8px;
            border-radius: 4px;
            font-family: monospace;
            font-size: 0.9em;
            border: 1px solid #ccc;
        }

        footer {
            text-align: center;
            margin-top: 40px;
            padding: 20px;
            color: #666;
        }

        @media (max-width: 768px) {
            .container {
                grid-template-columns: 1fr;
            }

            h1 {
                font-size: 2rem;
            }
        }
    </style>
</head>
<body>
<header>
    <h1>Maven项目刷新指南</h1>
    <p class="subtitle">解决Maven依赖和配置更新问题</p>
</header>

<div class="container">
    <div class="card ide-card">
        <h2>IDE中刷新</h2>
        <p><strong>IntelliJ IDEA:</strong></p>
        <ul>
            <li>右键项目 → Maven → Reimport</li>
            <li>使用Maven工具窗口的刷新按钮</li>
            <li>快捷键: <span class="key">Ctrl+Shift+O</span> (Win/Linux) 或 <span class="key">Cmd+Shift+O</span> (Mac)</li>
        </ul>

        <p><strong>Eclipse:</strong></p>
        <ul>
            <li>右键项目 → Maven → Update Project</li>
            <li>快捷键: <span class="key">Alt+F5</span></li>
        </ul>
    </div>

    <div class="card cli-card">
        <h2>命令行刷新</h2>
        <p>在项目根目录执行以下命令：</p>

        <div class="code">mvn clean compile</div>
        <p>清理并重新编译项目</p>

        <div class="code">mvn clean compile -U</div>
        <p>强制更新快照依赖</p>

        <div class="code">mvn dependency:resolve</div>
        <p>仅下载依赖</p>
    </div>

    <div class="card cache-card">
        <h2>清除缓存</h2>
        <p>如果遇到依赖问题，可能需要清除本地仓库缓存：</p>

        <div class="code"># 删除整个本地仓库(谨慎使用)
            rm -rf ~/.m2/repository</div>

        <div class="code"># 删除特定依赖
            rm -rf ~/.m2/repository/group-id/artifact-id</div>

        <p>注意：删除整个本地仓库会导致所有依赖重新下载，耗时较长。</p>
    </div>
</div>

<footer>
    <p>© 2023 Maven指南 | 更多信息请参考<a href="https://maven.apache.org/" style="color: #2575fc; text-decoration: none;">官方文档</a></p>
</footer>
</body>
</html>